<template>
	<view class="page bg-white">
		<view class="main">

			<!-- 选择讲师 -->
			<u-text margin="60rpx 0 0 0" color="#333" size="32rpx" text="选择要指派的讲师" bold></u-text>
			<view class="form-item" @click="showTeacherPopup = true">
				<u-text :text="formData.teacherInfo || '请选择要指派的讲师'" size="32rpx" color="#333"></u-text>
				<u-icon name="arrow-down" size="32rpx" color="#999"></u-icon>
			</view>

			<!-- 选择讲师弹窗 -->
			<up-picker :closeOnClickOverlay="true" :show="showTeacherPopup" :columns="teacherList"
				@close="showTeacherPopup = false" @confirm="handleTeacherConfirm"></up-picker>

		</view>
		<view class="footer" :style="{ boxShadow: '0rpx -4rpx 36rpx 0rpx ' + themeTertiary }">
			<u-button shape="circle" size="large" :color="themePrimary" text="提交"></u-button>
		</view>
	</view>
</template>
<script setup>
import { ref } from 'vue'
import { useTheme } from '@/composables/useTheme';
const { themePrimary, themeTertiary } = useTheme();

const formData = ref({
	teacherInfo: '',
})
// 选择讲师弹窗
const showTeacherPopup = ref(false)

// 讲师列表
const teacherList = ref([['李老师', '王老师', '张老师']])

const handleTeacherConfirm = (e) => {
	console.log(e)
	showTeacherPopup.value = false
	formData.value.teacherInfo = e.value[0]
}

</script>
<style scoped lang="scss">
.form-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #F7F7F7;
	padding: 30rpx;
	margin-top: 20rpx;
	border-radius: 20rpx;
}

.camera-icon {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 54rpx;
	height: 54rpx;
}
</style>